if (((typeof kid) == "undefined") || kid == null) {
	kid = {};
}

kid.isEmpty = function(object) {
	return (((typeof kid) == "undefined") || (object == null))
			|| (object == "");
};

kid.uuid = function() {
	'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
		var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;
		return v.toString(16);
	});
};

kid.getDayBegin = function() {
	var begin = new Date();
	begin.setHours(0);
	begin.setMinutes(0);
	begin.setSeconds(0);
	return begin;
};

kid.getDayEnd = function() {
	var end = new Date();
	end.setHours(23);
	end.setMinutes(59);
	end.setSeconds(59);
	return end;
};

kid.kidAjax = function(option) {

	var errorHandler = option.error;
	var successHandler = option.success;

	function processLogOut(data) {
		if (data.ok == false) {
			if (data.errorId == "session.001") {
				top.location = "index/index.jsp";
			}
			return true;
		}
		if (data.length <= 500 && data.indexOf('"errorId":"session.001"') >= 0
				&& data.indexOf('"ok":false') >= 0) {
			top.location = "index/index.jsp";
			return true;
		}
		return false;
	}

	option.error = function(data) {
		processLogOut(data);
		if (typeof errorHandler == "function") {
			var env = option.context || this;
			errorHandler.call(env, data);
		}
	};
	option.success = function(data) {
		var logout = processLogOut(data);
		if (logout == false) {
			if (typeof successHandler == "function") {
				var env = option.context || this;
				successHandler.call(env, data);
			}
		}
	};

	jQuery.ajax(option);

};